home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / elk-2_0.lha / elk-2.0 / examples / xaw / scrollbar < prev    next >
Encoding:
Text File  |  1991-09-26  |  570 b   |  23 lines

  1. ;;; -*-Scheme-*-
  2. ;;;
  3. ;;; Scrollbar widget demo
  4.  
  5. (require 'xwidgets)
  6. (load-widgets shell scrollbar)
  7.  
  8. (define top (application-initialize 'scrollbar))
  9.  
  10. (define scroll (create-managed-widget (find-class 'scrollbar) top
  11.                                       'thickness 35 'length 400))
  12.  
  13. (define (sp w x) (format #t "(scroll-proc ~s)~%" x))
  14. (define (jp w x) (format #t "(jump-proc ~s)~%" x))
  15.  
  16. (add-callback scroll 'scroll-proc sp)
  17. (set-values! scroll 'jump-proc (list jp))
  18.  
  19. (scrollbar-set-thumb! scroll 0.3 0.2)
  20.  
  21. (realize-widget top)
  22. (context-main-loop (widget-context top))
  23.